/* 全局变量（浅色模式） */
:root {
    --color-primary: #4a90e2;
    --color-primary-light: #f0f7ff;
    --color-accent: #fff;
    --color-text: #707070;
    --color-border: #ddd;
    --color-toggle: #ddd;
    --color-background-body: #e4e9f7;
    --color-background-component: #fff;
    --transition-fast: all 0.2s ease;
    --border-radius-medium: 8px;
}

/* 暗黑模式变量 */
body.dark {
    --color-primary: #3a3b3c;
    --color-primary-light: #3a3b3c;
    --color-accent: #ff4081;
    --color-text: #ccc;
    --color-border: #555;
    --color-toggle: #fff;
    --color-background-body: #18191a;
    --color-background-component: #242526;
}

/* 主题应用 */
body {
    background-color: var(--color-background-body);
    color: var(--color-text);
    font-family: Arial, sans-serif;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px;
    transition: var(--transition-fast);
}

#app-container {
    width: 1400px;
}

textarea {
    width: 100%;
    height: 100%;
    border: none;
    padding: 10px;
    font-size: 16px;
    background: var(--color-background-component);
    color: var(--color-text);
    outline: none;
    resize: none;
}

.preview {
    width: 50%;
    height: 100%;
    padding: 10px;
    border-left: 1px solid var(--color-border);
    background: var(--color-background-component);
    overflow-y: auto;
    display: none;
}

pre code {
    padding: 10px;
    border-radius: var(--border-radius-medium);
}

.theme-toggle {
    background: var(--color-primary);
    color: var(--color-accent);
    border: none;
    padding: 10px 15px;
    font-size: 14px;
    cursor: pointer;
    border-radius: var(--border-radius-medium);
    margin-bottom: 15px;
    transition: var(--transition-fast);
}

.theme-toggle:hover {
    background: var(--color-primary-light);
}

/* 工具栏样式 */
.toolbar {
    display: flex;
    width: 100%;
    background: var(--color-background-component);
    border: 1px solid var(--color-border);
    border-bottom: none;
    border-radius: var(--border-radius-medium) var(--border-radius-medium) 0 0;
    overflow: hidden;
    margin-bottom: 0;
    justify-content: space-between;
}

.toolbar-left {
    display: flex;
}

.toolbar-right {
    display: flex;
}

.editor-container {
    display: flex;
    width: 100%;
    height: 400px;
    border: 1px solid var(--color-border);
    border-radius: 0 0 var(--border-radius-medium) var(--border-radius-medium);
    overflow: hidden;
}

.toolbar-button {
    padding: 10px 15px;
    background: transparent;
    border: none;
    border-right: 1px solid var(--color-border);
    color: var(--color-text);
    cursor: pointer;
    transition: var(--transition-fast);
}

.toolbar-right .toolbar-button:last-child {
    border-right: none;
}

.toolbar-button:hover, .toolbar-button.active {
    background: var(--color-primary);
    color: var(--color-accent);
}

/* 全屏模式 */
.fullscreen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100% !important;
    height: 100% !important;
    z-index: 9999;
    border-radius: 0;
}

/* 全屏模式下的编辑器和预览 */
.fullscreen-mode .editor-container {
    display: flex;
}

.fullscreen-mode textarea,
.fullscreen-mode .preview {
    width: 50%;
    display: block;
}

.fullscreen-mode .preview {
    border-left: 1px solid var(--color-border);
}

/* 帮助面板 */
.help-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 10000;
    align-items: center;
    justify-content: center;
}

.help-content {
    background: var(--color-background-component);
    color: var(--color-text);
    padding: 20px;
    border-radius: var(--border-radius-medium);
    width: 50%;
    max-height: 80%;
    overflow-y: auto;
}

.help-content h3 {
    margin-top: 0;
}

.help-content table {
    width: 100%;
    border-collapse: collapse;
}

.help-content th, .help-content td {
    padding: 8px;
    text-align: left;
    border-bottom: 1px solid var(--color-border);
}

.close-help {
    float: right;
    background: transparent;
    border: none;
    color: var(--color-text);
    font-size: 1.5em;
    cursor: pointer;
}

/* 预览模式 */
.preview-mode .preview {
    width: 100%;
    border-left: none;
    display: block;
}

.preview-mode textarea {
    display: none;
}

/* 编辑模式 */
.edit-mode textarea {
    width: 100%;
}

.edit-mode .preview {
    display: none;
}
